﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UI_Layer.Pages
{
    /// <summary>
    /// Interaction logic for Confirmation.xaml
    /// </summary>
    public partial class Confirmation : Page
    {
        static int bookingnumber = 0;
        public Confirmation()
        {
            InitializeComponent();
            Confirmation_Message.Text = "Booking succesful! Your booking number is: " + bookingnumber;
        }

        private void Button_Close(object sender, RoutedEventArgs e)
        {
            MainPage mainpage = new MainPage();            
            NavigationService navservice = NavigationService.GetNavigationService(this);
            navservice.Navigate(mainpage);
        }

        public static int createBooking()
        {
            Parser parser = new Parser();
            string bookingNO = "";
            string url = "http://localhost/Service.svc/createBooking/" + BookingDetailsCreate.getPlateNumber + "/" + BookingDetailsCreate.getBookedTime;
            bookingNO = parser.getBookingNO(url);           
            int bookingnumber_return = Convert.ToInt32(bookingNO);
            bookingnumber = bookingnumber_return;
            return bookingnumber_return;
        }               
     
    }
}
